package com.fwtai.api;

import com.fwtai.bean.PageFormData;
import com.fwtai.datasource.DaoHandle;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 咨询访问数据库
 * @作者 田应平
 * @版本 v1.0
 * @创建时间 2021-08-10 11:19:15
 * @QQ号码 444141300
 * @Email service@yinlz.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Repository
public class ApiAdvisoryDao{

    @Resource
    private DaoHandle dao;

    public int add(final PageFormData formData){
        return dao.execute("api_advisory.add",formData);
    }

    public String queryExistById(final PageFormData formData){
        return dao.queryForString("api_advisory.queryExistById",formData);
    }

    public int edit(final PageFormData formData){
        return dao.execute("api_advisory.edit",formData);
    }

    public HashMap<String, Object> queryById(final String kid){
        return dao.queryForHashMap("api_advisory.queryById",kid);
    }

    public List<Map<String,Object>> getAdvisoryInfo(final String kid){
        return dao.queryForListMap("api_advisory.getAdvisoryInfo",kid);
    }

    public int delById(final String kid){
        return dao.execute("api_advisory.delById",kid);
    }

    public int delByKeys(final ArrayList<String> list){
        return dao.execute("api_advisory.delByKeys",list);
    }

    public List<Map<String,Object>> listData(final PageFormData formData){
        return dao.queryForListMap("api_advisory.listData",formData);
    }
}